package com.xatz.scanner

import com.xatz.ksoap2_android.SoapEnvelope
import com.xatz.scanner.bean.ReceiveGoodsBean
import com.xatz.scanner.bean.ResponseBean
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.*

/**
 * author: tdq
 * date: 2021/7/21
 * description:
 */
interface ScannerService {

    companion object {
        const val baseUrl = "http://www.sxjbjt.com:9084/Service1.asmx/" // 线上环境

        const val baseGoodsUrl = "http://www.sxjbjt.com:9531/" // 电商移库收货

        const val baseGoodsUrl9081 = "http://www.sxjbjt.com:9081/" // 电商移库收货

        const val namespace = "http://tempuri.org/"

        const val transUrl = "http://www.sxjbjt.com:9084/Service1.asmx"

        const val envolopeVersion = SoapEnvelope.VER11
    }

    /***
     * 登录接口
     */
    @GET("GetUserInfo")
//    @FormUrlEncoded
    fun login(
        @Query("name") loginName: String,
        @Query("pwd") password: String
    ): Call<String>

    @POST("GetFYDInfo")
    @FormUrlEncoded
    fun getFYDInfo(
        @Field("code") code: String,
        @Field("type") type: String
    ): Call<String>

    @POST("GetOutDatas")
    @FormUrlEncoded
    fun getOutDatas(
        @Field("code") barcode: String
    ): Call<String>

    @GET("GetCHPList")
    fun getCHPList(): Call<String>

    @POST("MWFHComplete")
    @FormUrlEncoded
    fun mWFHComplete(
        @Field("billcode") billcode: String,
        @Field("CPH") CPH: String,
        @Field("count") count: String,
        @Field("usercode") usercode: String,
    ): Call<String>

    @POST("api/mobile/confirmReceipt")
    fun confirmReceipt(
        @Body bean: ReceiveGoodsBean
    ): Call<ResponseBean>

    @GET("GetKFInfo")
    fun getKFInfo(): Call<String>

    @GET("GetDWInfo")
    fun getDWInfo(@Query("kufang") kufang: String): Call<String>

    @GET("GetOldInfo")
    fun getOldInfo(@Query("jch") jch: String): Call<String>

    @FormUrlEncoded
    @POST("GetZHUANGCHELIST")
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    fun getZhuangCheList(@Field("gangzhong") gangzhong: String?, @Field("zhijing") zhijing: String?, @Field("dingchi") dingchi: String?, @Field("zhishu") zhishu: String?, @Field("thkf") thkf: String?,): Call<String>

    @GET("GetDZTiDanInfo")
    fun getDZTiDanInfo(@Query("delivery") delivery: String): Call<String>

    @GET("BeSureLoadAmount")
    fun beSureLoadAmount(
        @Query("userId") userId: String,
        @Query("delivery") delivery: String,
        @Query("deliveryId") deliveryId: String,
        @Query("amount") amount: String,
    ): Call<String>

    @GET("BeWuXiaoChuChang")
    fun beWuXiaoChuChang(
        @Query("userId") userId: String,
        @Query("delivery") delivery: String,
        @Query("wuxiao") wuxiao: String,
    ): Call<String>

    @GET("GetWuXiaoReasons")
    fun getWuXiaoReasons(): Call<String>

    @POST("zbsapi/getSellBatchNo")
    fun soldStockOutReceipt(
        @Body body: RequestBody
    ): Call<ResponseBean>
}